<!-- 路由导航组件 -->
<template>
  <footer class="nav-bar">
    <router-link
      v-for="(item, index) in navList"
      :key="index"
      :to="item.path"
      exact-active-class="active">
      <span class="icon iconfont nav-icon" :class="item.icon"></span>
      <span class="nav-title">{{ item.title }}</span>
    </router-link>
  </footer>
</template>

<script>
export default {
  name: 'NavBar',
  components: {},
  data () {
    return {
      navList: [
        {
          title: '任务发布',
          path: '/TaskSend',
          icon: 'icon-renwufabu'
        },
        {
          title: '日志填写',
          path: '/record',
          icon: 'icon-rizhi'
        },
        {
          title: '未分配',
          path: '/taskAssign',
          icon: 'icon-renwu'
        },
        {
          title: '个人中心',
          path: '/user',
          icon: 'icon-noassignee'
        }
      ]
    }
  },
  methods: {}
}
</script>

<style scoped lang="less">
@import '../assets/icons/iconfont.css';
.nav-bar {
  height: 1.5rem;
  width: 100%;
  background: #FFF;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 49;
  border-top: 1px solid #ebedf0;
  display: flex;
  a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    .nav-icon {
      width: 16px;
      height: 16px;
      color: #646566;
    }
    .nav-title {
      font-size: .36rem;
      color: #646566;
      margin-top: 2px;
    }
    &.active {
      .nav-icon {
        color: burlywood;
      }
      .nav-title {
        color: burlywood;
      }
    }
  }
}
</style>
